package serviceImpl;

import entity.User;
import dao.InvitateDAO;
import serviceInterface.invitateInterface;

import java.sql.*;
/**
 * @author 藤树
 * */
public class invitate implements invitateInterface {
    @Override
    public boolean invitate(User user, String invitee_id, String content) throws SQLException {
        boolean hasUser = InvitateDAO.HasUser(user);

        if(hasUser){
            boolean res = InvitateDAO.InsertInvitate( user.getId(), invitee_id, content, user.getNickname());
            return res;
        }else{
            System.out.println("用户不存在");
            return false;
        }
    }
}